Skip to content

Conversation

@maxisbey
Copy link
Contributor

Summary

Add a conformance testing pipeline that validates the Python SDK against the @modelcontextprotocol/conformance npm package. This mirrors the approach used in the TypeScript SDK.

Changes

New Files

  • examples/clients/conformance-client/ - Unified conformance test client

    • Handles all test scenarios via environment variables and CLI arguments
    • Supports OAuth authorization code flow (default for all auth scenarios)
    • Supports client credentials with client_secret_basic and private_key_jwt
  • scripts/run-server-conformance.sh - Server conformance test runner

    • Starts the everything-server on port 3001
    • Waits for server readiness
    • Runs npx @modelcontextprotocol/conformance server
  • .github/workflows/conformance.yml - CI workflow

    • server-conformance job: Tests the Python SDK server implementation
    • client-conformance job: Tests the Python SDK client implementation
    • Both jobs use continue-on-error: true to match the TS SDK approach

Test Results (Local)

Test Type Passed
Server 24/24
Client (metadata suite) 36/36
Client (auth suite) 108/108
Client (sep-835 suite) 48/48

Running Locally

# Server conformance
./scripts/run-server-conformance.sh

# Client conformance (individual suites)
npx @modelcontextprotocol/conformance client --command 'uv run --frozen mcp-conformance-client' --suite metadata
npx @modelcontextprotocol/conformance client --command 'uv run --frozen mcp-conformance-client' --suite auth
npx @modelcontextprotocol/conformance client --command 'uv run --frozen mcp-conformance-client' --suite sep-835

Add a conformance testing pipeline that validates the Python SDK against
the @modelcontextprotocol/conformance npm package.

Changes:
- Add conformance-client example that handles all test scenarios
  (auth flows, metadata, scope handling)
- Add run-server-conformance.sh script to test the everything-server
- Add GitHub Actions workflow with server-conformance and client-conformance jobs
- Both jobs use continue-on-error: true to match TS SDK approach

The conformance client supports:
- OAuth authorization code flow (default)
- Client credentials with client_secret_basic
- Client credentials with private_key_jwt
- All auth/metadata and sep-835 scope scenarios

Test results:
- Server: 24/24 passed
- Client: 192/192 passed (metadata, auth, sep-835 suites)
The --all-packages flag triggers a pre-existing issue where
mcp-simple-chatbot is missing its README.md. Use --package to
install only the specific packages needed for each job.
The conformance package requires either --suite or --scenario.
The newer version (0.1.10) supports --suite all.
Copy link
Member

@Kludex Kludex Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this not be a package, and not be in examples? You can create its own GitHub action for it under .github/actions, and use it in conformance.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep fair, this draft was claude mostly one shotting it and then I was gonna clean it up. Any thoughts on where it should go?

- Extract shared default_elicitation_callback that applies schema defaults
  from ElicitRequestFormParams.requested_schema.properties.*.default
- Add elicitation callback to _run_auth_session so all OAuth flows
  advertise elicitation capability
- Call first available tool dynamically instead of hardcoded test-tool
- Add results/ directory to .gitignore
The conformance client now passes a client_metadata_url to
OAuthClientProvider, matching the TypeScript SDK's conformance client.
This allows the SDK's existing CIMD support to activate when the server
advertises client_id_metadata_document_supported=true, resolving the
auth/basic-cimd warning.
Address review feedback: the conformance client is CI test
infrastructure, not a user-facing example. Move it to
scripts/conformance/client.py as a standalone script and colocate it
with the server script (renamed from scripts/run-server-conformance.sh
to scripts/conformance/run-server.sh).

This removes the mcp-conformance-client workspace member and its
lockfile entry. The client script is now run directly via
uv run python scripts/conformance/client.py.
Same treatment as the unified conformance client: this is CI test
infrastructure, not a user-facing example. Moved to
scripts/conformance/auth-client.py and removed as a workspace member.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants